<?php
namespace Acme\TaskBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;

class TaskType extends AbstractType 
{
  public function buildForm(FormBuilder $builder, array $options)  
  {
  	$builder->add('task');
  	$builder->add('dueDate', 'date', array('widget' => 'single_text') );
  	$builder->add('description');
  	$builder->add('category', new CategoryType());
  }
  
  public function getDefaultOptions(array $options)
  {
  	return array(
  	 'data_class' => 'Acme\TaskBundle\Entity\Task',
  	 'csrf_protection' => true,
  	 'csrf_field_name' => '_token',
  	 // an unique key to help generate the secret token
  	 'intention' => 'task_item',
  	);
  }
  
  public function getName()  
  {
  	return 'task';
  }
}
